/*
Navicat SQL Server Data Transfer

Source Server         : riley_test
Source Server Version : 150000
Source Host           : 192.168.1.106:1433
Source Database       : bosch
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 150000
File Encoding         : 65001

Date: 2023-09-25 16:01:06
*/


-- ----------------------------
-- Table structure for Bosch_ASN_header
-- ----------------------------
DROP TABLE [dbo].[Bosch_ASN_header]
GO
CREATE TABLE [dbo].[Bosch_ASN_header] (
[id] varchar(128) NOT NULL ,
[doc_number] varchar(8) NOT NULL ,
[doc_create_time] datetime NOT NULL ,
[estimated_arrival_date] datetime NULL ,
[request_ship_datetime] datetime NOT NULL ,
[total_gross_weight] varchar(18) NULL ,
[total_net_weight] varchar(18) NULL ,
[total_volume] varchar(18) NULL ,
[transport_contract_number] varchar(70) NOT NULL ,
[good_shipment_number] varchar(70) NULL ,
[transport_order_number] varchar(70) NULL ,
[buyer_id] varchar(35) NOT NULL ,
[buyer_name] varchar(70) NOT NULL ,
[buyer_street] varchar(35) NOT NULL ,
[buyer_country] varchar(9) NULL ,
[buyer_city] varchar(35) NOT NULL ,
[buyer_postal] varchar(35) NOT NULL ,
[buyer_contact] varchar(256) NULL ,
[buyer_communication] varchar(512) NULL ,
[seller_id] varchar(35) NOT NULL ,
[seller_name] varchar(70) NOT NULL ,
[seller_street] varchar(35) NOT NULL ,
[seller_city] varchar(35) NOT NULL ,
[seller_country] varchar(9) NULL ,
[seller_postal] varchar(17) NOT NULL ,
[seller_contact] varchar(256) NULL ,
[seller_communication] varchar(512) NULL ,
[ship_to_id] varchar(35) NOT NULL ,
[ship_to_name] varchar(70) NOT NULL ,
[ship_to_city] varchar(35) NOT NULL ,
[ship_to_country] varchar(9) NULL ,
[ship_to_postal] varchar(17) NOT NULL ,
[ship_to_street] varchar(35) NOT NULL ,
[discharge_place] varchar(35) NULL ,
[ship_to_contact] varchar(256) NULL ,
[ship_to_communication] varchar(512) NULL ,
[ship_from_id] varchar(35) NULL ,
[ship_from_name] varchar(70) NULL ,
[ship_from_city] varchar(35) NULL ,
[ship_from_country] varchar(9) NULL ,
[ship_from_postal] varchar(17) NULL ,
[ship_from_street] varchar(35) NULL ,
[ship_from_contact] varchar(256) NULL ,
[ship_from_communication] varchar(512) NULL ,
[freight_forwarder_id] varchar(35) NULL ,
[freight_forwarder_name] varchar(35) NULL ,
[freight_forwarder_city] varchar(35) NULL ,
[freight_forwarder_country] varchar(9) NULL ,
[freight_forwarder_postal] varchar(17) NULL ,
[freight_forwarder_street] varchar(35) NULL ,
[freight_forwarder_message] varchar(256) NULL ,
[freight_forwarder_communication] varchar(512) NULL ,
[equipment_type] varchar(3) NULL ,
[equipment_number] varchar(17) NULL ,
[status] varchar(1) NULL 
)


GO

-- ----------------------------
-- Table structure for Bosch_ASN_item
-- ----------------------------
DROP TABLE [dbo].[Bosch_ASN_item]
GO
CREATE TABLE [dbo].[Bosch_ASN_item] (
[id] varchar(128) NOT NULL ,
[item_number] varchar(35) NOT NULL ,
[batch_number] varchar(35) NULL ,
[despatch_quantity] varchar(35) NOT NULL ,
[origin_country] varchar(3) NULL ,
[serial_number] varchar(35) NULL ,
[expiry_date] datetime NULL ,
[production_datetime] datetime NULL ,
[manufacturer_number] varchar(35) NULL ,
[order_number] varchar(70) NOT NULL ,
[order_line_number] varchar(6) NULL ,
[invoice_number] varchar(70) NOT NULL ,
[delivery_schedule_number] varchar(70) NULL ,
[delivery_line_number] varchar(6) NULL ,
[event_number] varchar(70) NULL ,
[event_line_number] varchar(6) NULL ,
[discharge_place] varchar(35) NOT NULL ,
[Internal_place] varchar(35) NULL ,
[header_id] varchar(128) NOT NULL 
)


GO

-- ----------------------------
-- Table structure for Bosch_ASN_pallet
-- ----------------------------
DROP TABLE [dbo].[Bosch_ASN_pallet]
GO
CREATE TABLE [dbo].[Bosch_ASN_pallet] (
[id] varchar(128) NOT NULL ,
[item_id] varchar(128) NOT NULL ,
[head_id] varchar(128) NOT NULL ,
[package_quantity] varchar(6) NOT NULL ,
[package_type] varchar(35) NOT NULL ,
[package_gross_weight] varchar(18) NOT NULL ,
[package_net_weight] varchar(18) NOT NULL ,
[package_length] varchar(18) NOT NULL ,
[package_width] varchar(18) NOT NULL ,
[package_height] varchar(18) NOT NULL ,
[per_pack_quantity] varchar(35) NULL ,
[package_additional_information] varchar(30) NULL ,
[package_type_code] varchar(3) NOT NULL ,
[outer_pallet_number] varchar(70) NULL ,
[manufacture_datetime] datetime NULL ,
[inner_number] varchar(128) NOT NULL ,
[pallet_type_code] varchar(3) NULL ,
[kanban_card_id] varchar(35) NULL ,
[outer_package_quantity] varchar(8) NULL ,
[outer_package_type] varchar(35) NULL ,
[outer_package_info] varchar(35) NULL ,
[outer_package_gross_weight] varchar(18) NULL ,
[outer_package_net_weight] varchar(18) NULL ,
[outer_package_length] varchar(18) NULL ,
[outer_package_width] varchar(18) NULL ,
[outer_package_height] varchar(18) NULL ,
[maximum_quantity] varchar(35) NULL ,
[contain_inner_quantity] varchar(35) NULL ,
[additional_information] varchar(30) NULL ,
[outer_package_number] varchar(35) NULL ,
[inner_package_number] varchar(35) NULL ,
[type] varchar(35) NOT NULL 
)


GO

-- ----------------------------
-- Table structure for Bosch_DELFOR_header
-- ----------------------------
DROP TABLE [dbo].[Bosch_DELFOR_header]
GO
CREATE TABLE [dbo].[Bosch_DELFOR_header] (
[id] varchar(99) NOT NULL ,
[doc_number] varchar(8) NULL ,
[doc_create_time] datetime NULL ,
[note] varchar(512) NULL ,
[text_information] varchar(512) NULL ,
[idoc_number] varchar(70) NULL ,
[buyer_id] varchar(35) NULL ,
[buyer_name] varchar(35) NULL ,
[buyer_street] varchar(35) NULL ,
[buyer_city] varchar(35) NULL ,
[buyer_postal] varchar(17) NULL ,
[regist_number] varchar(35) NULL ,
[buyer_contact] varchar(35) NULL ,
[buyer_communication] varchar(512) NULL ,
[seller_id] varchar(35) NULL ,
[seller_name] varchar(35) NULL ,
[seller_street] varchar(35) NULL ,
[seller_city] varchar(35) NULL ,
[seller_postal] varchar(17) NULL ,
[seller_contact] varchar(35) NULL ,
[seller_communication] varchar(512) NULL ,
[freight_forwarder_id] varchar(35) NULL ,
[freight_forwarder_name] varchar(35) NULL ,
[freight_forwarder_street] varchar(35) NULL ,
[freight_forwarder_city] varchar(35) NULL ,
[freight_forwarder_postal] varchar(17) NULL ,
[invoicee_id] varchar(35) NULL ,
[invoicee_name] varchar(35) NULL ,
[invoicee_street] varchar(35) NULL ,
[invoicee_city] varchar(35) NULL ,
[invoicee_postal] varchar(17) NULL ,
[invoicee_contact] varchar(35) NULL ,
[invoicee_communication] varchar(512) NULL ,
[ship_from_id] varchar(35) NULL ,
[ship_from_name] varchar(35) NULL ,
[ship_from_street] varchar(35) NULL ,
[ship_from_city] varchar(35) NULL ,
[ship_from_postal] varchar(17) NULL ,
[ship_to_id] varchar(35) NULL ,
[ship_to_name] varchar(35) NULL ,
[ship_to_street] varchar(35) NULL ,
[ship_to_city] varchar(35) NULL ,
[ship_to_postal] varchar(17) NULL ,
[discharge_place] varchar(35) NULL ,
[addition_place] varchar(35) NULL ,
[ship_to_information] varchar(512) NULL ,
[ship_to_contact] varchar(35) NULL ,
[ship_to_communication] varchar(512) NULL 
)


GO

-- ----------------------------
-- Table structure for Bosch_DELFOR_line
-- ----------------------------
DROP TABLE [dbo].[Bosch_DELFOR_line]
GO
CREATE TABLE [dbo].[Bosch_DELFOR_line] (
[id] varchar(99) NOT NULL ,
[header_id] varchar(99) NOT NULL ,
[line_number] varchar(6) NULL ,
[package_code] varchar(3) NULL ,
[item_number] varchar(35) NULL ,
[article_number] varchar(35) NULL ,
[item_type] varchar(3) NULL ,
[additional_id] varchar(35) NULL ,
[item_description] varchar(256) NULL ,
[item_long_description] varchar(256) NULL ,
[origin_country] varchar(3) NULL ,
[general_information] varchar(512) NULL ,
[delivery_schedule_number] varchar(70) NULL ,
[delivery_schedule_datetime] datetime NULL ,
[pervious_delivery_number] varchar(70) NULL ,
[pervious_delivery_datetime] datetime NULL ,
[order_number] varchar(70) NULL ,
[order_datetime] datetime NULL ,
[last_received_quantity] varchar(35) NULL ,
[last_despatch_number] varchar(70) NULL ,
[last_despatch_datetime] datetime NULL ,
[cumulative_received_quantity] varchar(35) NULL ,
[cumulative_qty_start_datetime] datetime NULL ,
[backorder_quantity] varchar(35) NULL 
)


GO

-- ----------------------------
-- Table structure for Bosch_DELFOR_schdule
-- ----------------------------
DROP TABLE [dbo].[Bosch_DELFOR_schdule]
GO
CREATE TABLE [dbo].[Bosch_DELFOR_schdule] (
[id] varchar(99) NOT NULL ,
[head_id] varchar(99) NULL ,
[detail_id] varchar(99) NULL ,
[plan_code] varchar(3) NULL ,
[frequency] varchar(3) NULL ,
[delivery_quantity] varchar(35) NULL ,
[request_datetime] datetime NULL ,
[earliest_datetime] datetime NULL ,
[latest_datetime] datetime NULL ,
[request_ship_datetime] datetime NULL ,
[cumulative_quantity] varchar(35) NULL ,
[commitment] varchar(3) NULL ,
[author_month_number] varchar(35) NULL ,
[author_date] datetime NULL ,
[author_material_date] datetime NULL ,
[author_material_month] varchar(35) NULL 
)


GO

-- ----------------------------
-- Indexes structure for table Bosch_ASN_header
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table Bosch_ASN_header
-- ----------------------------
ALTER TABLE [dbo].[Bosch_ASN_header] ADD PRIMARY KEY ([id])
GO

-- ----------------------------
-- Indexes structure for table Bosch_ASN_item
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table Bosch_ASN_item
-- ----------------------------
ALTER TABLE [dbo].[Bosch_ASN_item] ADD PRIMARY KEY ([id])
GO

-- ----------------------------
-- Indexes structure for table Bosch_ASN_pallet
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table Bosch_ASN_pallet
-- ----------------------------
ALTER TABLE [dbo].[Bosch_ASN_pallet] ADD PRIMARY KEY ([id])
GO

-- ----------------------------
-- Indexes structure for table Bosch_DELFOR_header
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table Bosch_DELFOR_header
-- ----------------------------
ALTER TABLE [dbo].[Bosch_DELFOR_header] ADD PRIMARY KEY ([id])
GO

-- ----------------------------
-- Indexes structure for table Bosch_DELFOR_line
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table Bosch_DELFOR_line
-- ----------------------------
ALTER TABLE [dbo].[Bosch_DELFOR_line] ADD PRIMARY KEY ([id])
GO

-- ----------------------------
-- Indexes structure for table Bosch_DELFOR_schdule
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table Bosch_DELFOR_schdule
-- ----------------------------
ALTER TABLE [dbo].[Bosch_DELFOR_schdule] ADD PRIMARY KEY ([id])
GO
